import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
// 引入ys-ui组件
import YSUI from '../src'
Vue.use(YSUI)

// 引入element-ui
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI)


import icon from './assets/icon.json';
import ysicon from '../src/assets/less/icons/iconfont.json';


import YSJS from 'ys-ui/src/common/common';
Vue.prototype.$utils=YSJS


// 引入demo-block
import DemoBlock from './components/demoBlock'
Vue.component('demo-block', DemoBlock)
// 引入项目样式入口
import './assets/less/index.less'
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

Vue.prototype.$icon = icon; // Icon 列表页用
Vue.prototype.$ysicon = ysicon; // ysIcon 列表页用


// 引入路由
import routes from './route'
Vue.use(VueRouter)
const router = new VueRouter({
  routes
})
/* eslint-disable no-new */
new Vue({
  render(createElement) {
    return createElement(App)
  },
  router
}).$mount('#app')
